package com.zy.web.demo.shejimoshi.danli;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/19 9:28
 * 懒汉式，线程安全
 * 线程安全，但是效率太低了，第一次调用的时候才初始化
 */
public class DanLi2 {

    private static DanLi2 danLi2;

    public DanLi2(){};

    public static synchronized DanLi2 getInstance(){
        if (danLi2 == null){
            danLi2 = new DanLi2();
        }
        return danLi2;
    }


}
